import count from '@dfeidao/atom-nodejs/db/count';
import query from '@dfeidao/atom-nodejs/db/query';
import { IncomingHttpHeaders } from 'http';
import { productid, systemid } from '../../atom/config';
interface Message {
	filter: {
		pn: number,
		staff_no: string
	};
}
export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const p = query(action_id, session_id, systemid);
	p.prepare('company_project', ['project_name', 'project_no'],
		{ productid, project_manager_no: message.filter.staff_no }, 200, 1, [], []);
	const [dtt] = await p.exec();
	// 查询数据总条数
	const { prepare, exec } = count(action_id, session_id, systemid);
	prepare('asset_inventory', { productid });
	const [c] = await exec();
	return { c, dtt };
}
